﻿#pragma once
#include "BCGPDialog.h" 
#include <afxdtctl.h>  
#include "resource.h"   
#include <Windows.h>   
#define WM_DATE_SELECTED (WM_USER + 100)
class CMyMonthCal : public CBCGPDialog {

	DECLARE_DYNAMIC(CMyMonthCal)

public:
	CMyMonthCal(CWnd* pParent = nullptr);
	virtual ~CMyMonthCal();

	enum { IDD = IDD_DLG_DATARANGE }; 

	/* 添加获取选定日期的方法 (返回 SYSTEMTIME)*/
	BOOL GetStartDate(SYSTEMTIME& st) const;
	BOOL GetEndDate(SYSTEMTIME& st) const;

	/* 添加设置初始日期的方法 (参数为 SYSTEMTIME)*/
	void SetStartDate(const SYSTEMTIME& st);
	void SetEndDate(const SYSTEMTIME& st);
	COleDateTime m_dtStart, m_dtEnd; /*保存选择的日期范围*/
	BOOL GetSelectedDates(COleDateTime& dtStart, COleDateTime& dtEnd) const;

protected:
	virtual void DoDataExchange(CDataExchange* pDX); 
	virtual BOOL OnInitDialog();

	CMonthCalCtrl m_startCal; /* 绑定第一个日历控件*/
	CMonthCalCtrl m_endCal;   /* 绑定第二个日历控件*/
	COleDateTime m_SelectedDate;
	CWnd* m_pNotifyWnd;
	/*重载OnOK*/
	virtual void OnOK();


	DECLARE_MESSAGE_MAP()
};